package com.hexiang.config;

import com.hexiang.log.LogAspect;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

@ConditionalOnClass(LoggerFactory.class)
@Configuration
public class LoggingConfig {


    /**
     * 打印Web控制器日志
     *
     * @return Web日志控制
     */
    @Order(Ordered.LOWEST_PRECEDENCE)
    @Bean
    public LogAspect webControllerLogAspect() {
        return new LogAspect();
    }

}